<template>
	<scroll-view class="bg-white nav" scroll-x>
		<view class="flex text-center" style="font-size: 30upx;">
			<view class="cu-item flex-sub" :class="index==TabCur?'text-orange cur':''" 
			v-for="(item,index) in tabList" :key="index" @tap="tabSelect" :id="index">
				{{item.category_name}}
			</view>
		</view> 
	</scroll-view>
</template>

<script>
	export default {
		data() {
			return {
			};
		},
		onLoad() {
		}, 
		methods: {
			// 选项卡点击
			tabSelect(e) {
				uni.$emit('tabEvent', {index: Number(e.currentTarget.id)})
			}
		},
		props: {
			tabList: {
				type: Array,
				default: function(){return []}
			},
			TabCur: {
				type: Number,
				default: 0
			}
		}
	}
</script>

<style lang="scss">
	.positionFixed {
	  position: fixed;
	  left: 0;
	  top: 0;
	  width: 100vw;
	  height: 100vh;
	  z-index: 999;
	}
</style>
